package com.springcloud.jwt;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "jwt")
public class JwtConfigProperty {
    /**
     * JWT加密密钥
     */
    private String jwtKey;
    /**
     * JWT签发者名称
     */
    private String issuer;
    /**
     * 过期时间(秒)
     */
    private int expirationMinute = 24 * 60 * 60;

    /**
     * 请求header内的key
     */
    private String header = "Authorization";
    /**
     * 请求header内的key对应value 的默认开头
     */
    private String tokenHead = "Bearer ";

    public String getJwtKey() {
        return jwtKey;
    }

    public void setJwtKey(String jwtKey) {
        this.jwtKey = jwtKey;
    }

    public String getIssuer() {
        return issuer;
    }

    public void setIssuer(String issuer) {
        this.issuer = issuer;
    }

    public int getExpirationMinute() {
        return expirationMinute;
    }

    public void setExpirationMinute(int expirationMinute) {
        this.expirationMinute = expirationMinute;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public String getTokenHead() {
        return tokenHead;
    }

    public void setTokenHead(String tokenHead) {
        this.tokenHead = tokenHead;
    }

    @Override
    public String toString() {
        return "JwtConfigProperty [jwtKey=" + jwtKey + ", issuer=" + issuer + ", expirationMinute=" + expirationMinute
                + ", header=" + header + ", tokenHead=" + tokenHead + "]";
    }
}
